﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DBUtils;

/// <summary>
/// 该页面对应着功能说明书的明细记录页。
/// </summary>
public partial class Attendance_ShowAttendDetail : System.Web.UI.Page
{
    DataSet dsResult;
    int iEmpID;
    /// <summary>
    /// 网页初始化时执行该方法。显示该员工在该时间段内的所有考勤详细信息。
    /// 该过程调用 Attendance.QueryIndividual(iEmpID, lblStartTime.Text.Trim, lblEndTime.Text.Trim, dsResult) 函数，
    /// 在数据库中检索该员工在该时间段内的所有考勤信息。
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        //测试
        lblStartTime.Text = "2000-01-01";
        lblEndTime.Text = "2010-01-01";
        //
        iEmpID = Convert.ToInt32(Request.QueryString["id"]);
        if (Attendance.QueryIndividual(iEmpID, lblStartTime.Text.Trim(), lblEndTime.Text.Trim(), ref dsResult) == 1)
        {
            if (dsResult.Tables[0].Rows.Count != 0)
            {
                grdResult.DataSource = dsResult.Tables[0];
                grdResult.DataBind();
                grdResult.Visible = true;
            }
            else
            {
                lblMessage.Visible = true;
            }
        }
    }

    /// <summary>
    /// 后退
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}
